package mi.payment.settings;

import java.io.Serializable;

import mi.payment.constants.Configs;

/**
 * 交易开关设置
 *
 * @author sunmi on 2017/2/12.
 */
public class TransactionSwitchSetting implements Serializable {

    // 新增了boolean字段，不再适配之前的旧的内容，即可使用最新信息
    private static final long serialVersionUID = 7298174385228450164L;

    public static final String TRANSACTION_SWITCH_KEY = "TransactionSwitchKey";

    private boolean consumption = true;             //    消费 1支持，0不支持
    private boolean consumptionRevoke = true;       //    消费撤销 1支持，0不支持
    private boolean returnGoods = true;             //    退货 1支持，0不支持
    private boolean queryBalance = true;            //    查询余额 1支持，0不支持
    private boolean fieldAuth = true;               //    预授权 1支持，0不支持
    private boolean fieldAuthRevoke = true;         //    预授权撤销 1支持，0不支持
    private boolean fieldAuthReq = true;            //    预授权完成 1支持，0不支持
    private boolean fieldAuthCompleteRevocationNotice = true;   // 预授权完成（通知） 1支持，0不支持
    private boolean fieldAuthCompleteRevocation = true;         // 预授权完成撤销 1支持，0不支持
    private boolean autoChecked = true;                         // 自动用01账号登录

    // ----------------------------------------//
    //     扫码交易开关相关字段
    //-----------------------------------------//
    private boolean useWeChatScan = Configs.getInstance().USE_WECHAT_SCAN();    // 是否使用微信支付,商户扫客户
    private boolean useAliPayScan = Configs.getInstance().USE_ALIPAY_SCAN();    // 是否使用支付宝支付，商户扫客户
    private boolean useWeChatQR = Configs.getInstance().USE_WECHAT_QR_CODE();   // 是否使用微信支付,客户扫商户
    private boolean useAliPayQR = Configs.getInstance().USE_ALIPAY_QR_CODE();   // 是否使用支付宝支付，客户扫商户
    private boolean useKouBei = true;                                           // 是否使用口碑支付
    private boolean useUnionPayScan = Configs.getInstance().USE_UNION_SCAN();   // 是否使用银联支付,客户扫商户
    private boolean useUnionPayQR = Configs.getInstance().USE_UNION_CODE();     // 是否使用银联支付,客户扫商户
    private boolean useMiPay = true;                                            // 是否使用小米支付 商户扫客户

    public boolean isAutoChecked() {
        return autoChecked;
    }

    protected void setAutoChecked(boolean autoChecked) {
        this.autoChecked = autoChecked;
    }

    @Override
    public String toString() {
        return "TransactionSwitchSetting{" +
                "consumption=" + consumption +
                ", consumptionRevoke=" + consumptionRevoke +
                ", returnGoods=" + returnGoods +
                ", queryBalance=" + queryBalance +
                ", fieldAuth=" + fieldAuth +
                ", fieldAuthRevoke=" + fieldAuthRevoke +
                ", fieldAuthReq=" + fieldAuthReq +
                ", fieldAuthCompleteRevocationNotice=" + fieldAuthCompleteRevocationNotice +
                ", fieldAuthCompleteRevocation=" + fieldAuthCompleteRevocation +
                ", autoChecked=" + autoChecked +
                ", useWeChatScan=" + useWeChatScan +
                ", useAliPayScan=" + useAliPayScan +
                ", useWeChatQR=" + useWeChatQR +
                ", useAliPayQR=" + useAliPayQR +
                ", useKouBei=" + useKouBei +
                ", useUnionPayScan=" + useUnionPayScan +
                ", useUnionPayQR=" + useUnionPayQR +
                ", useMiPay=" + useMiPay +
                '}';
    }

    public boolean isConsumption() {
        return consumption;
    }

    public boolean isConsumptionRevoke() {
        return consumptionRevoke;
    }

    public boolean isReturnGoods() {
        return returnGoods;
    }

    public boolean isQueryBalance() {
        return queryBalance;
    }

    public boolean isFieldAuth() {
        return fieldAuth;
    }

    public boolean isFieldAuthRevoke() {
        return fieldAuthRevoke;
    }

    public boolean isFieldAuthReq() {
        return fieldAuthReq;
    }

    public boolean isFieldAuthCompleteRevocationNotice() {
        return fieldAuthCompleteRevocationNotice;
    }

    public boolean isFieldAuthCompleteRevocation() {
        return fieldAuthCompleteRevocation;
    }

    protected void setConsumption(boolean consumption) {
        this.consumption = consumption;
    }

    protected void setConsumptionRevoke(boolean consumptionRevoke) {
        this.consumptionRevoke = consumptionRevoke;
    }

    protected void setReturnGoods(boolean returnGoods) {
        this.returnGoods = returnGoods;
    }

    protected void setQueryBalance(boolean queryBalance) {
        this.queryBalance = queryBalance;
    }

    protected void setFieldAuth(boolean fieldAuth) {
        this.fieldAuth = fieldAuth;
    }

    protected void setFieldAuthRevoke(boolean fieldAuthRevoke) {
        this.fieldAuthRevoke = fieldAuthRevoke;
    }

    protected void setFieldAuthReq(boolean fieldAuthReq) {
        this.fieldAuthReq = fieldAuthReq;
    }

    protected void setFieldAuthCompleteRevocationNotice(boolean fieldAuthCompleteRevocationNotice) {
        this.fieldAuthCompleteRevocationNotice = fieldAuthCompleteRevocationNotice;
    }

    protected void setFieldAuthCompleteRevocation(boolean fieldAuthCompleteRevocation) {
        this.fieldAuthCompleteRevocation = fieldAuthCompleteRevocation;
    }

    public boolean isUseWeChatScan() {
        return useWeChatScan;
    }

    protected void setUseWeChatScan(boolean useWeChatScan) {
        this.useWeChatScan = useWeChatScan;
    }

    public boolean isUseAliPayScan() {
        return useAliPayScan;
    }

    protected void setUseAliPayScan(boolean useAliPayScan) {
        this.useAliPayScan = useAliPayScan;
    }

    public boolean isUseKouBei() {
        return useKouBei;
    }

    protected void setUseKouBei(boolean useKouBei) {
        this.useKouBei = useKouBei;
    }

    public boolean isUseUnionPayScan() {
        return useUnionPayScan;
    }

    protected void setUseUnionPayScan(boolean useUnionPayScan) {
        this.useUnionPayScan = useUnionPayScan;
    }

    public boolean isUseWeChatQR() {
        return useWeChatQR;
    }

    protected void setUseWeChatQR(boolean useWeChatQR) {
        this.useWeChatQR = useWeChatQR;
    }

    public boolean isUseAliPayQR() {
        return useAliPayQR;
    }

    protected void setUseAliPayQR(boolean useAliPayQR) {
        this.useAliPayQR = useAliPayQR;
    }

    public boolean isUseUnionPayQR() {
        return useUnionPayQR;
    }

    protected void setUseUnionPayQR(boolean useUnionPayQR) {
        this.useUnionPayQR = useUnionPayQR;
    }

    public boolean isUseMiPay() {
        return useMiPay;
    }

    public void setUseMiPay(boolean useMiPay) {
        this.useMiPay = useMiPay;
    }

}
